use rand::random;



/// 生成csrf_token
pub fn gen_csrf_token() -> String {
    let mut token:String = String::from("");
    (0..8).for_each(|_| {
        let a: f64 = 65536.0 * (1.0 + random::<f64>());
        let b: i64 = a.floor().floor() as i64;
        let c = format!("{:x}", b);
        let code = &c[1..];
        token += code;
    });
    return token;
}